<% if current_user_impersonated? %>
  <div data-controller="impersonation-warning" data-impersonation-warning-session-ends-at-value="<%= impersonation_session_ends_at.iso8601 %>" class="flash warning my-0 flex justify-center text-center">
    <div class="flash__message">
      <%= t(".description_html", user_name: current_user.name) %>
      <%= t(".expire_time_html", minutes: impersonation_session_remaining_duration_in_minutes) %>
      <div class="mt-4">
        <%= button_to t(".close_session"), decidim_admin.close_session_impersonatable_user_impersonations_path(current_user), class: "button button__secondary button__sm impersonation-bar__button", data: { disable: true } %>
      </div>
    </div>
  </div>
<% end %>
